<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>运营后台-用户管理</title>
<%--公共jsp,包含通用css样式和js引用 --%>
<%@ include file="/WEB-INF/pages/common/common.jsp"%>
</head>
<body>
	<div>修改密码</div>
	原密码:<input type="password" id="old"/>
	新密码:<input type="password" id="new1"/>
	新密码(确认):<input type="password" id="new2"/>
	<button onclick="confirm()">确认修改</button>
	<script>
		function confirm() {
		    var new1 = $('#new1').val();
            var new2 = $('#new2').val();
            var old = $('#old').val()

			if(old=="" ||new1==""||new2==""){
                alert("请正确输入信息");
                return;
			}
			if(new1!=new2){
			    alert("两次密码输入不正确,请重新输入");
                return;
			}
			$.getJSON('/system/user/changePwd',{oldPwd:old,newPwd:new1},function (res) {
			    alert(res.msg);
			    if(res.code==0){
			        window.location.reload();
				}
            });
        }
	</script>
</body>
</html>